package com.woniuxy.direct.service.impl;

import com.woniuxy.direct.service.DirectService;
import com.woniuxy.pojo.TopicMail;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DirectServiceImpl implements DirectService {
    @Autowired
    RabbitTemplate rabbitTemplate;
    @Override
    public void send(TopicMail topicMail) {
        rabbitTemplate.convertAndSend("directEx",topicMail.getRoutingkey(),topicMail);
    }
}
